using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BreakBird : Bird
{
    [SerializeField] private float boomRadius = 2.5f;
    
    protected override void FullTimeSkill()
    {
        Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, boomRadius);//以某个点为圆心，半径为boomRadius，检测所有碰撞体
        foreach (Collider2D collider in colliders)
        {
            Destructiable des = collider.GetComponent<Destructiable>();
            if (des != null)
            {
                des.TakeDamage(Int32.MaxValue);//给一个无限大的伤害(可以扩充以半径向外衰减伤害)
            }
        }
        
        state = BirdState.WaitToDie;
        LoadNexBird();
    }
}
